﻿using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RabbitMQ.BLL;
using RabbitMQWeb.DB;

namespace RabbitMQWeb.Demo.Controllers
{
    public class HomeController : Controller
    {
        // GET: Home
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Save(RabbitMQ_UserInfo model)
        {
            dynamic obj = new ExpandoObject();
            try
            {
                var IsSave = new RabbitMQ_UserInfoBll().SaveUserInfo(model);
                obj.Success = IsSave;
                obj.Message = "注册成功";
            }
            catch (Exception e)
            {
                obj.Success = false;
                obj.Message = e.Message;
                throw;
            }
            return Json(obj, JsonRequestBehavior.AllowGet);
        }
    }
}